/**
 * 
 */
package com.nandasoft.njurep.substance.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.stereotype.Repository;
import com.nandasoft.njuerp.common.dao.BaseDao;
import com.nandasoft.njurep.substance.bean.WareStoreBean;
import com.nandasoft.njurep.substance.dao.WareStoreDao;

/**
 * 事务主体数据操作Dao
 * 
 * @author Administrator
 *
 */
@Repository("wareStoreDao")
public class WareStoreDaoImpl extends BaseDao<WareStoreBean> implements WareStoreDao {

	@Override
	public void insertWareStoreInfo(WareStoreBean bean) {
		// TODO Auto-generated method stub
		String sql = "insert into T_WARE_STORE values (:id,:billcode,:typecode,:causecode,:warecode,:kyear,:kmonth,:oppWare,"
				+ " :ordercode,:clientcode,:supcode,:deptcode,:note,:bIlldate,:billman,:station,:checker,:handler,:createtag,"
				+ ":invcode,:accntTag,:accntDate,:accntMan,:accntPassDate,:confirmPerson,:classno,:confirmDate,"
				+ ":auditor,:auditdate,:sysnum,:createtype,:doctmpl,:rejectType,:rejectReason,:consultion,:state,:createdBy,cTime,:updateBy,:utime)";
		SqlParameterSource paramSource = new BeanPropertySqlParameterSource(bean);
		insert(sql, paramSource);
	}

	@Override
	public void updateWareStoreInfo(WareStoreBean bean) {
		// TODO Auto-generated method stub
		String sql="update T_WARE_STORE  set  state = :state where id=:id";
		Map<String, String> map = new HashMap<String, String>();
		map.put("state", bean.getState());
		map.put("id", bean.getId());
		update(sql, map);
	}
	/* (non-Javadoc)
	 * @see com.nandasoft.njurep.substance.dao.WareStoreDao#updateWareStoreInfo(java.lang.String, java.lang.String)
	 */
	@Override
	public void updateWareStoreInfo(String wId, String state) {
		// TODO Auto-generated method stub
		String sql="update T_WARE_STORE  set  state = :state where id=:id";
		Map<String, String> map = new HashMap<String, String>();
		map.put("state", state);
		map.put("id", wId);
		update(sql, map);
	}

	@Override
	public void delWareStoreInfo(WareStoreBean bean) {
		// TODO Auto-generated method stub
		bean.setState("4");
		updateWareStoreInfo(bean.getId(),bean.getState());
	}

	@Override
	public List<WareStoreBean> getWareStoreList(WareStoreBean bean) {
		// TODO Auto-generated method stub
		String sql="";
//		queryForList(sql, ps, rowMapper);
		return null;
	}

	@Override
	public List<WareStoreBean> getWareStorePageList(WareStoreBean bean) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public WareStoreBean getWareStoreInfo(WareStoreBean bean) {
		// TODO Auto-generated method stub
		return null;
	}

}
